package com.liyong.pullorder.sdk.exception;

/**
 * @author 葡萄味的萝卜
 * @date 2025/10/21 13:12
 * 网络异常
 * 核心作用：标识网络通信相关的错误
 * 触发场景：连接超时、读取超时、DNS解析失败
 * 处理策略：可重试，通过重试机制应对网络抖动
 */
public class NetworkException extends PullOrderException{
    private final String requestUrl;

    public NetworkException(String message, String platformCode) {
        super(message, "NETWORK_TIMEOUT", platformCode);
        this.requestUrl = null;
    }

    public NetworkException(String message, String platformCode, String requestUrl) {
        super(message, "NETWORK_TIMEOUT", platformCode);
        this.requestUrl = requestUrl;
    }

    public NetworkException(String message, Throwable cause, String platformCode, String requestUrl) {
        super(message, cause, "NETWORK_TIMEOUT", platformCode);
        this.requestUrl = requestUrl;
    }

    public String getRequestUrl() {
        return requestUrl;
    }
}
